package com.supcon.exchangedata.repository.slave6;


import com.supcon.exchangedata.pojo.entity.mysql.operation.hj.HjEnvGarbageDeal;
import com.supcon.exchangedata.pojo.entity.mysql.operation.sw.WaterDailyOpertionInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *   水务日运营数据
 * @Author: yangbin
 * @Date: 2022/04/20/9:00
 * @Description:
 */
public interface SlaveHjOperationInfo2 extends JpaRepository<HjEnvGarbageDeal, Long> {


    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM hj_env_garbage_deal WHERE biz_time = (SELECT MAX(biz_time) FROM hj_env_garbage_deal)")
    List<HjEnvGarbageDeal> findTopData();

    List<HjEnvGarbageDeal> findAllByBizTimeBetween(LocalDateTime startTime, LocalDateTime endTime);


}
